package com.example.service_oss.controller;

import com.example.common.commonsutils.R;
import com.example.service_oss.service.OssService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author:tjf
 * @Description:
 */
@RestController
@Tag(name = "oss控制器")
@RequestMapping("/eduoss")
public class OssController {
    @Resource
    private OssService ossService;
    @Operation(description = "头像上传")
    @PostMapping(value = "/avatar/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R uploadAvatar(@RequestPart MultipartFile file){
        return ossService.handleAvatarUpload(file);
    }
}
